package com.qianyu.project.web.controller.gs;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qianyu.project.entity.AttachemenInfo;
import com.qianyu.project.service.IAttachemenInfoService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gs
 * @date create in 2021/2/1 21:39
 */
@RestController
@RequestMapping("/attachemenInfos")
public class AttachemenInfoController {

    @Autowired
    private IAttachemenInfoService attachemenInfoService;

    @GetMapping("/{id}")
    public Result getById(@PathVariable String id) {
        return ResultTool.success(
                attachemenInfoService.list(
                        new QueryWrapper<AttachemenInfo>()
                        .in("id", (Object[]) id.split(","))
                )
        );
    }
}
